<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
</head>
<body>
    <div id="cal">
        <input type="text" v-model="num1">
        <select name="sign"  v-model="opt">
            <!-- <option value=""></option> -->
            <option value="+">+</option>
            <option value="-">-</option>
            <option value="*">*</option> 
            <option value="/">/</option>
        </select>
        <input type="text" v-model="num2">
        <button @click="computed"> = </button>
        <!-- <input type="text" v-model="result" > -->
        <span>
            <span v-if="this.opt === '+' ">
                {{  parseInt(this.num1) + parseInt(this.num2)}}
            </span>
            <span v-else-if="this.opt === '-' ">
                    {{  parseInt(this.num1) - parseInt(this.num2)}}
            </span>
            <span v-else-if="this.opt === '*' ">
                    {{  parseInt(this.num1) * parseInt(this.num2)}}
            </span>
            <span v-else-if="this.opt === '/' ">
                    {{  parseInt(this.num1) / parseInt(this.num2)}}
            </span>  

        </span>
    </div>     

    <script>
        var vm = new Vue({
            el: "#cal",
            data: {
                num1: 1,
                num2: 1,
                opt: "+",
                result: null
            },
            methods: {
                computed: function () {
                    this.result =  eval(this.num1 + this.opt + this.num2);
                    // console.log(result);
                }
            }
        });
    </script>
</body>
</html>